package com.diaohaiwen.framework.web.listener;

import jakarta.annotation.Resource;
import org.apache.catalina.startup.Tomcat;
import org.springframework.boot.web.embedded.tomcat.TomcatWebServer;
import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext;
import org.springframework.stereotype.Component;

import java.util.concurrent.Executor;

/**
 * @author 刁海文
 * @since 2023/6/13 20:56
 * @Remark Web 容器监听类
 */
@Component
public class WebContainerListener {
    @Resource
    ServletWebServerApplicationContext applicationContext;
    public void listener(){
        final TomcatWebServer tomcatWebServer = (TomcatWebServer) applicationContext.getWebServer();
        Tomcat tomcat = tomcatWebServer.getTomcat();
        Executor executor = tomcat.getConnector().getProtocolHandler().getExecutor();

    }

}
